package action;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.Empregado;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import dao.BD;
import dao.EmpregadoBD;


public class DualAction extends DispatchAction{
	
	public ActionForward listar(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		ArrayList<Empregado> listaSQL = EmpregadoBD.buscarEmpregados(BD.SQL_SERVER);
		ArrayList<Empregado> listaPOST = EmpregadoBD.buscarEmpregados(BD.POSTGRES);
		
		request.setAttribute("listaSQL", listaSQL);
		request.setAttribute("listaPOST", listaPOST);
		
		return mapping.findForward("dualbank");
	}
}
